feat(clerk-js,clerk-react,nextjs,types): Drop experimental tag from GoogleOneTap - #3392
Merged
Conversation
🦋 Changeset detectedLatest commit: e97824f The changes in this PR will be included in the next version bump. This PR includes changesets to release 14 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
panteliselef
commented
May 16, 2024
Comment on lines
-228
to
-248
| public __experimental_authenticateWithGoogleOneTap = async ( | ||
| params: __experimental_AuthenticateWithGoogleOneTapParams, | ||
| ): Promise<SignInResource | SignUpResource> => { | ||
| return this.create({ | ||
| // TODO-ONETAP: Add new types when feature is ready for public beta | ||
| // @ts-expect-error | ||
| strategy: 'google_one_tap', | ||
| googleOneTapToken: params.token, | ||
| }).catch(err => { | ||
| if (isClerkAPIResponseError(err) && err.errors[0].code === 'external_account_not_found') { | ||
| return SignIn.clerk.client?.signUp.create({ | ||
| // TODO-ONETAP: Add new types when feature is ready for public beta | ||
| // @ts-expect-error | ||
| strategy: 'google_one_tap', | ||
| googleOneTapToken: params.token, | ||
| }); | ||
| } | ||
| throw err; | ||
| }) as Promise<SignInResource | SignUpResource>; | ||
| }; | ||
|
|
Contributor
Author
There was a problem hiding this comment.
This is moved to Clerk.ts
panteliselef
commented
May 16, 2024
Comment on lines
+988
to
+993
| authenticateWithGoogleOneTap = async ( | ||
| params: AuthenticateWithGoogleOneTapParams, | ||
| ): Promise<SignInResource | SignUpResource> => { | ||
| const clerkjs = await this.#waitForClerkJS(); | ||
| return clerkjs.authenticateWithGoogleOneTap(params); | ||
| }; |
Contributor
Author
There was a problem hiding this comment.
I want to highlight this change. This goes against the pattern we already have. But I cannot think of a reason why we cannot do this.
chanioxaris
approved these changes
May 20, 2024
panteliselef
enabled auto-merge (squash)
May 20, 2024 17:28
9 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Add support for GoogleOneTap. New APIs listed:
React component
<GoogleOneTap/>Customize the UX of the prompt
Use the component from with Vanilla JS
Clerk.openGoogleOneTap(props: GoogleOneTapProps)Clerk.closeGoogleOneTap()Low level APIs for custom flows
await Clerk.authenticateWithGoogleOneTap({ token: 'xxxx'})await Clerk.handleGoogleOneTapCallback()We recommend using this two methods together in order and let Clerk to perform the correct redirections.
In case you want to handle the redirection and session management yourself you can do so like this
Checklist
npm testruns as expected.npm run buildruns as expected.Type of change